import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

class HonorDemoPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return HonorDemoPageState();
  }
}

class HonorDemoPageState extends State<HonorDemoPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Tag例子')),
      body: Container(
        child: Center(
          child: InkWell(
              onTap: () {
                return Navigator.of(context)
                    .push(MaterialPageRoute(builder: (context) {
                  return HonorDemoPageState1();
                }));
              },
              child: Hero(
                tag: 'image',
                child: Image.asset(
                  'static/gsy_cat.png',
                  fit: BoxFit.cover,
                  width: 60,
                  height: 60,
                ),
              )),
        ),
      ),
    );
  }
}

class HonorDemoPageState1 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Tag例子')),
      body: Container(
        child: Center(
          child: InkWell(
              onTap: () {
                return Navigator.of(context).pop();
              },
              child: Hero(
                tag: 'image',
                child: Image.asset(
                  'static/gsy_cat.png',
                  fit: BoxFit.cover,
                  width: MediaQuery.of(context).size.width,
                  height: MediaQuery.of(context).size.height,
                ),
              )),
        ),
      ),
    );
  }
}
